"""
1) 上课代码的案例再敲一遍

2) 准备ecshop的数据库

1. 准备ecshop.sql这个文件
   1. 通过navicat工具导入mysql中
      1. 创建一个数据库ecshop
      2. 导入ecshop.sql文件

3) Sql练习

    -- ecs_goods 商品表
    -- ecs_brand 品牌表

A. 查询卖的最贵的商品的名称
select goods_name from ecs_goods where shop_price =
(select max(shop_price) from ecs_goods);

B. 查询商品品牌为”仓品”的 所有商品名称和商品价格
select goods_name, shop_price from ecs_goods where brand_id =
(select brand_id from ecs_brand where brand_name = '仓品');

C. 查询商品品牌为”仓品”的 所有商品名称和商品价格 按照价格降序排列
select  goods_name, shop_price from ecs_goods where brand_id =
(select brand_id from ecs_brand where brand_name = '仓品') order by shop_price DESC

D. 查询每个商品品牌的商品数量
select brand_id,count(*),sum(goods_number) from ecs_goods group by brand_id;

E. 查询商品品牌对应的商品数量大于5的商品品牌名称
select brand_id,count(*),sum(goods_number) from ecs_goods group by brand_id having count(*) > 5;
"""